import { PageReq } from "@/typings/api";
import { Role, CreateRoleReq, UpdateRoleReq } from "@/typings/api/role";
import { request } from "@/utils/request";

export const getRoleList = (params: PageReq<Role>) => request.get("/role", { params });
export const getRoleRecord = (_id: string) => request.get(`/role/${_id}`);
export const createRole = (data: CreateRoleReq) => request.post("/role", data);
export const updateRole = (data: UpdateRoleReq) => request.put("/role", data);
export const deleteRole = (_id: string) => request.delete("/role", { data: { _id } });